<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8"/>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
		<meta name="HandheldFriendly" content="true"/>
		<meta name="MobileOptimized" content="320"/>
		<title>工程评审管理</title>
		<script type="text/javascript" src="../js/common.js"></script>
		<script src="../js/mui.min.js"></script>
		<script src="../js/tiza.js"></script>
		<script src="js/zepto.min.js"></script>
		<script src="../js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
		mui.init();
// H5 plus事件处理
function confirmdelete(){
	var btnArray = ['否', '是'];
	mui.confirm('删除所有内容将无法恢复,确认？', 'Hello MUI', btnArray, function(e) {
					if (e.index == 1) {
						mui.toast('你删除了所有文件');
					} else {
						mui.toast('你们放弃了删除');
					}
					});
}
var ret=null;
function plusReady(){
	
	readpic();
	//ret=plus.storage.getItem("uploader");
	//update();
}
if(window.plus){
	plusReady();
}else{
	document.addEventListener("plusready",plusReady,false);
}
// DOM事件
var ce=null;
document.addEventListener("DOMContentLoaded",function(){
	ce=document.getElementById("dcontent");
	update();
},false);
// 更新内容
var fs=null;
function update(){
	if(!ret||!ce)return;
	var j=JSON.parse(ret);
	var ih='<br/>Datas:<br/><div style="text-align:left;padding:10px 2%;">';
	var ds=j.strings;
	for(d in ds){
		ih += d+" : "+ds[d]+"<br/>";
	}
	ih+='</div><hr/>Files:<br/><div id="fl">';
	fs=j.files;
	for(f in fs){
		ih += '<a class="fitem" onclick="plus.runtime.openURL(\'http://demo.dcloud.net.cn/helloh5/uploader/'+fs[f].url+'\')">'+fs[f].name+'</a>';
	}
	ih+='</div>';
	ce.innerHTML=ih;
}
// 清除上传返回的数据
function resetUploader(){
	plus.storage.setItem("uploader","");
	
}
// 删除上传的文件
function deleteFiles(){
	var url="http://demo.dcloud.net.cn/helloh5/uploader/delete.php?";
	for(f in fs){
		url += f+"="+fs[f].name+"&";
	}
	var r=new plus.net.XMLHttpRequest();
	r.open('GET',url);
	r.send();
	document.getElementById('fl').innerHTML="";
}
function showImg() {
    var _img_ = new Image();
					_img_.style.border = "1px solid rgb(200,199,204)";
			        _img_.style.margin = "10px";
			        _img_.style.width = "100px";
			        _img_.style.height = "100px";
					_img_.src=result.Data;
					var div=document.getElementsByClassName("dcontent")[0];
						div.appendChild(_img_);
}
function readpic() {
        	plus.nativeUI.showWaiting();
        	//showImg("http://10.3.0.144/FileUpload/ReadPic")
        	tiza.ajax("FileUpload/ReadPic2",{
					traditional :true, 
					type: "get",	
					data:{"FileArr":11},
					dataType:"json",
					success:function(result){												
						if (resule.Code == "20000") {
							showImg();	
						}
						plus.nativeUI.closeWaiting();
							mui.toast(resule.Msg);
					}
				});      	
}
		</script>
		<script type="text/javascript" src="../js/common.js"></script>
		<style type="text/css">
.fitem {
	width: 96%;
	overflow: hidden;
	padding: 10px 2%;
	border-bottom: 1px solid #c6c6c6;
	color: #6c6c6c;
	text-align: left;
	text-decoration: none;
	display: block;
}
.fitem:active {
	background: #f4f4f4;
}
.fname {
	font-weight: bolder;
	height: 22px;
	font-size: 16px;
}
.iclear {
	background: no-repeat center center url();
	background-size: 50px 44px;
}
		</style>
		<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8"/>
	<link rel="stylesheet" href="../css/mui.min.css">
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" onclick="back(true);" ></a>

			<h1 class="mui-title">详情</h1>
			<div class="nvbt iclear mui-icon-right-nav mui-pull-right" onclick="confirmdelete()"></div>
		</header>	
		<!--<header id="header">
			<div class="nvbt iback" onclick="resetUploader();back();"></div>
			<div class="nvtt">Uploaded Data&amp;File</div>
			<div class="nvbt iclear" onclick="deleteFiles()"></div>
		</header>-->
		<div id="dcontent" class="dcontent">
			
		</div>
	</body>
	<script type="text/javascript" src="../js/immersed.js" ></script>
</html>